﻿package mortal.game.view.mount.data
{
    import Message.DB.Tables.*;
    import Message.Public.*;
    import mortal.game.resource.tableConfig.*;

    public class MountData extends Object
    {
        private var _tMountConfig:TMountConfig;
        private var _sPublicMount:SPublicMount;

        public function MountData(param1)
        {
            if (param1 is SPublicMount)
            {
                this.sPublicMount = param1;
            }
            else if (param1 is int)
            {
                this._tMountConfig = MountConfig.instance.getMountInfoByCode(param1);
            }
            else if (param1 is TMountConfig)
            {
                this._tMountConfig = param1;
            }
            return;
        }// end function

        public function set tMountConfig(param1:TMountConfig) : void
        {
            this._tMountConfig = param1;
            return;
        }// end function

        public function get tMountConfig() : TMountConfig
        {
            return this._tMountConfig;
        }// end function

        public function set sPublicMount(param1:SPublicMount) : void
        {
            this._sPublicMount = param1;
            this._tMountConfig = MountConfig.instance.getMountInfoByCode(this.sPublicMount.code);
            return;
        }// end function

        public function get sPublicMount() : SPublicMount
        {
            return this._sPublicMount;
        }// end function

        public function set mountLevel(param1:int) : void
        {
            this._sPublicMount.code = param1;
            this._tMountConfig = MountConfig.instance.getMountInfoByCode(this.sPublicMount.code);
            return;
        }// end function

        public function get mountLevel() : int
        {
            return this._tMountConfig.code;
        }// end function

    }
}
